/**
 * Created by Administrator on 2018/11/24.
 *
 * <input type="text" lay-verify="required|pass"/>
 */
var verify_rule = {
    title: function (value) {
        if (value.length < 5) {
            return '标题至少得5个字符啊';
        }
    },
    pass: [/(.+){6,12}$/, '密码必须6到12位'],
    mobile: function (value) {
        if (value == null || value == undefined || value.trim() == "") {

        } else if (/^1\d{10}$/.test(value)) {

        } else {
            return "手机号不合法";
        }
    },
    max: function (value, item) {
        var $item = $(item);
        var maxLength = $item.attr("max-length");
        if (maxLength != undefined && maxLength != "" && value.length > maxLength) {
            return "长度/值不能多于" + maxLength;
        }
    },
    min: function (value, item) {
        var $item = $(item);
        var minLength = $item.attr("min-length");
        if (minLength != undefined && minLength != "" && value.length < minLength) {
            return "长度/值不能少于" + minLength;
        }
    }
}
